package com.yxzc.chapter06.constructor

/**
 *
 * @author wu
 * @create 2021-09-09-19:35 
 */
object ConDemo04 {
  def main(args: Array[String]): Unit = {
    val worker = new Worker("1")
    worker.name
    val worker1 = new Worker2("1")
    worker1.initName="ok"
  }

}

class Worker(initName: String) {
  var name = initName
}

class Worker2(var initName: String) {
  var name = initName
}

class Worker3(val initName: String) {
  var name = initName
}